require "UnLua"
local SGame = Class()

local UserName="Null"

function SGame:Construct()
    self.BtnSend.OnClicked:Add(self,self.Send)
end

function SGame:Send()
    print("DiaoYong")
    local ChatMessage=UE4.FChatMessage()
    ChatMessage.ChatInfo=self.InputText:GetText()
    local name=self:GetOwningPlayer().PlayerReadyInfo.PlayerName
    ChatMessage.PlayerName=name
    print(self:GetOwningPlayer().PlayerReadyInfo.PlayerName)
    if(self:GetOwningPlayer()~=nil) then
        self:GetOwningPlayer():SendChatMessageCToS(ChatMessage)
    end
    
    print("DiaoYongToServerEnd")
    self.InputText:SetText("")
end


return SGame